﻿using ALMDDD.Application.ViewModels.SysUser;
using ALMDDD.Domain.Commands.SysUser;
using ALMDDD.Domain.Model;
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Text;

namespace ALMDDD.Application.AutoMapper
{
    /// <summary>
    /// 视图转换为领域对象
    /// </summary>
    public class ViewToDomainModelMapping : Profile
    {
        public ViewToDomainModelMapping()
        {
            ///视图转换为实体
            CreateMap<SysUserViewModel, Sys_User>();
            //创建映射 学生视图模型转换成注册命令
            CreateMap<SysUserViewModel, AddUserCommand>()
                .ConstructUsing(c => new AddUserCommand(c.Id, c.UserId, c.UserName, c.Gender, c.PassWord, c.Email, c.Phone, c.TrxTime));

        }


    }
}
